package com.wjbgn.bsolver.server.controller;

import com.wjbgn.bsolver.server.dto.BugAnsweredRecordDTO;
import com.wjbgn.bsolver.server.service.IBugAnswerAcceptRejectService;
import com.wjbgn.stater.dto.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: bug回复的用户采纳和无用记录
 * Create Date: 2022-05-11T14:01:17.965
 *
 * @author wjbgn
 * @version 1.0
 */
@Api(tags = "bug回复的用户采纳和无用记录")
@RestController
@RequestMapping("/bugansweracceptreject")
@AllArgsConstructor
public class BugAnswerAcceptRejectController {

    /**
     * BugAnswerAcceptRejectService
     */
    private IBugAnswerAcceptRejectService bugAnswerAcceptRejectService;


    /**
     * 更新采纳或反对数量
     *
     * @param bugAnsweredRecordDTO
     * @return
     */
    @ApiOperation(value = "更新采纳或反对数量")
    @PostMapping("/updateAcceptReject")
    public Result updateAcceptReject(@RequestBody BugAnsweredRecordDTO bugAnsweredRecordDTO) {
        boolean b = bugAnswerAcceptRejectService.updateAcceptReject(bugAnsweredRecordDTO);
        return b ? Result.success() : Result.failed();
    }
}